home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Precision Software Appli…tions Silver Collection 4
/
Precision Software Applications Silver Collection Volume 4 (1993).iso
/
new
/
smashdoc.arj
/
DOCSMASH.DOC
< prev
next >
Wrap
Text File
|
1993-02-20
|
19KB
|
378 lines
DOCSMASH (TM) -- by David W. Rettger
====================================
DOCSMASH may be copied and passed to other users only if this
document file accompanies the executable program file and both
remain intact. No party other than the author may change the
contents of these files or charge any fee for distribution (other
than a nominal sum to cover the cost of a floppy disk and mailing
fees).
If you have benefitted from the use of DOCSMASH, please contribute
toward to costs of creating and updating this program by sending
$10.00 to:
David Rettger
5304 Johnson Avenue
Western Springs, Il. 60558
Updated versions are not attempts to get more money from registered
users. They are my efforts to continue to improve this program.
After registering, please feel free to use future new versions free
of charge. If you notice that the asking price has gone up and
you feel that the additional enhancements are useful, send a
contribution for the increase only.
=================================================================
DOCSMASH.EXE - Version 3.2
Purpose:
--------
The program reduces the size of printed output on normal
8.5 x 11 inch paper by a factor of 4. That is to say, on a
graphics-capable printer a 200 page document will print out in 50
pages or less. The total compression that may be achieved will be
determined by the type of hardware in use. (My nine pin printer gets
five pages of text on each sheet.)
This program is intended to print out such things as program
manuals, BBS listings, and any other ASCII TEXT. Some users have
commented that DOCSMASH will not print out documents created by
word processors. They are correct. Form feed codes are the only
soft codes (tabs, margins, etc.) filtered out by DOCSMASH. Such
codes will play havoc with the final output. To print such text
with DOCSMASH, first resave the document in ASCii format with your
word processor.
Operation:
----------
DOCSMASH may be run from the current subdirectory or from the DOS
path. At the DOS prompt, type the name "DOCSMASH" to begin. The
first prompt you will see asks for the name of the document you
wish to print. At this point you may:
- Type the name of a file to print.
- Display a Help Menu
- Change printer configuration.
- Change screen colors.
- Display a directory
- Change subdirectory
- End the DOCSMASH session.
The alternate method of starting the program is to type DOCSMASH
followed by the path\name of the file to print. No menu will be
shown, instead the file will be opened and the print routine will
commence as explained below. (Ex: DOCSMASH DOCSMASH.DOC will cause
the DOCSMASH.DOC file to be printed from the current subdirectory.)
Printing a File:
----------------
Printing a file is as easy as typing its name. It will then ask
if you want to begin printing at the beginning, or in the middle,
or if you wish to print something else instead. Just hit <ENTER>
to begin the printing. If your printer is on, it should begin
printing four pages of text per sheet of paper. If your first run
results in strange looking output, you must change your printer
settings. (See below.) In the event that things are going well,
but the print job is interrupted, you may restart the print and
specify that you want to start at some middle point. You will be
asked to type a phrase. DOCSMASH will search the file for that
phrase and begin the printing on the line FOLLOWING the phrase.
Note: The search feature is case sensitive. Type the phrase
exactly as you expect it to appear in the document.
Another new feature available at this point in the program is the
option to tell the program to pause between page breaks. This will
enable users to feed individual sheets of paper into their
printers. More importantly, if double sided printing is desired,
turn the Page Break Pause ON by hitting <F3>. The <F3> key will
act as an ON/OFF toggle switch whenever the "Page Break Pause"
status box is visible on the screen. Just think of the compression
factor available here. On wide computer paper you can get at least
six pages of text per side. That means at least 12 pages of print
per sheet of printer paper! (OK, so who uses wide paper. You
probably will have to settle for eight pages of text per sheet of
paper.)
Display the Help Menu:
----------------------
Hit the <F1> key to bring up a simple help menu. It displays the
special phrases and keystrokes that DOCSMASH is looking for at this
point in the program. Hit any key to resume. (Note: The help menu
will not function on certain monochrome systems. If your system
is not compatible, you will see a notice when you start DOCSMASH
that indicates that the <F1> key has been disabled.)
Change Printer Settings:
------------------------
Changing the printer settings is easy if you have an Epson
compatible printer. Instead of typing a document name, type RESET
PARAMS (or just hit <ENTER>). The Parameter Control Menu will
appear that shows the current settings. These settings and the
preset defaults are:
Page Format Settings:
Print Width Setting = 164
Number of Columns to Print = 2
Number of Pages Per Column = 2
Lines Per Page Printed = 58
Max Blank Lines to Print = 4
Word Wrap Is Now = ON
Epson Printer Control Settings:
N/216th's Inch Line Feed = 17
Paper Length in Inches = 11
Left Margin Column Setting = 0
The group labeled "Page Format Settings" have nothing to do with
control codes sent to the printer. They determine how the program
will layout the printing. Print width is the number of characters
that will be printed across the entire page. A print width setting
of 164, with 2 print columns specified will result in two 80-width
columns separated by 4 spaces. Each column of print can be split
into multiple pages. A setting of 2 for "Pages Per Column" results
in the four quadrant format DOCSMASH was initially designed around.
Set this value to one and you will get the most compression.
"Lines Printed Per Page" refers to the individual pages in each
column. If a single column would be filled using a setting of 124,
then a column broken into two pages obviously would need 62 lines
per page. To maximize compression, DOCSMASH tries to throw out
excess "White Space", blank lines of text. The default setting
will allow up to four consecutive blank lines. Conceivably, a zero
setting can be used, but the final output would be hard to read.
A setting of, say, 80 would most likely result in the text coming
through just as the author had typed it.
Versions 3.2 and higher now include user contolled word wrap. All
early versions assumed that maximum compression was the ultimate goal. In
the event a text line exceeded the column print width, word wrap caused
the excess length to drop down a line. The next line was read and tacked
on the same print line until the end of the column was reached. The net
effect sometimes was to entirely reformat the paragraph.
Word Wrap is now a four position "toggle switch". The options are ON, OFF,
AUTO-INDENT, and TRUNCATE. The default position is ON, which is the
method always used by DOCSMASH in the past. Selecting OFF causes excess
line length to be placed left-margin justified on the next line. The
next read text line will print on a new line. If the excess line length
happened to be a single word, that word would appear alone on its own line.
The AUTO-INDENT feature was designed with programmers in mind. Much
source code is formatted with specific indentations from the left margin
to mark blocks of codes such as loops and subroutines. With this setting
excess line length will drop to the next line, but will not be left
justified. If the line it came from began in the tenth column, the excess
print will also begin in the tenth column. No further reformatting will
be done. Both AUTO-INDENT and OFF modes will attempt to break lines
between words. The TRUNCATE mode does just what it says. If excess line
length occurs, it disappears from the print out. I can not guess who would
want such an option, but I am sure that if it were not included I would
get all kinds of correspondence asking for it!
The second group of settings refers to the EPSON control codes sent
to the printer to achieve the "mini" print size. The line feed
setting of 17 refers to 17/216's of an inch. Reset this one as
desired. The closer they are, the more you can fit on a page.
The paper length setting should match the size paper you want to
use. The left margin setting can be adjusted in the event you
position your paper specially for certain word processors or if
you just want to punch holes in the left side of the page. On
narrow carriage printers, a wide left margin will eat into the
width that is available for printing.
Exiting this menu will cause the settings to be saved in a file
called DOCSMASH.CFG on the root directory of the logged drive.
Any time DOCSMASH starts on this drive, it will restore the
settings you have entered. To get back to the defaults, delete
the \DOCSMASH.CFG file.
As mentioned previously, the Page Format Settings control how
DOCSMASH sets up a page to be printed. They are not printer
control codes. The control codes sent to the printer are as
follows:
Code Name Code Symbol ASCii Representation
--------- ----------- --------------------
Printer Reset Esc @ 27,64
Elite Mode Esc M 27,77
Condensed Mode Shift In 15
Subscript Mode Esc S 0 27,83,0
Line Feed Width Esc 3 n 27,51,n *
Left Margin Esc l n 27,108,n *
Paper Length Esc C Null n 27,67,0,n *
* "n" is a variable set by the user.
This combination, sent in this order, is the method used to create
the small print. The codes sent are Epson codes and will not work
on Toshiba and other printers. Also, some Epson types will not
accept both condensed and elite modes. If your hardware will not
go into a "mini" print mode with the above settings, you can create
your own set of printer control codes.
Another set of printers which is not entirely compatible with these
commands are 24 pin printers. They tend to run over to the next
page with my default settings. The NEC P2200, for instance, does
not use the 216th's inch line feed mode. It should be set up in
its 360th's of an inch mode as if it were a not-Epson compatible
printer.
Printers Not Epson Compatible:
------------------------------
If you intend to use a printer which is not Epson compatible (such
as Toshiba or Hewlett-Packard printers), or even some Epson
compatibles that happen to require slightly different codes, you
may customize the codes DOCSMASH will send to the printer. When
prompted for a document name, type RESET PRINTER (or hit F5). A
list of the codes currently in use will appear. The top item will
be highlighted. Use the cursor control keys to move the
highlighted bar. The left column is a list of the codes by name.
The right column is each code represented in decimal ASCii format.
The order the codes appear in can be changed to suit your needs, with
one exception. The code for reset printer must be the first code, at
the top of the menu. The lines labeled "Extra" are just that, extra.
They are merely place holders to show where room exists for users to
enter lines of code. If left blank, a null is sent to the printer.
Making changes to the list is easy. To change a code label in the
left-hand column, go to the appropriate row and type the label you
want. When you hit ENTER or move the bar, your new label will
appear in the left column. To change the code values, simply type
the needed ASCii codes, separating each number with a comma. Note:
You MUST use the commas to delimite ASCii numbers and do not type
any spaces! Labels must begin with non-numeric characters. To
entirely delete an entry, type a space. If a mistake is made while
typing, just backspace normally. Backspacing over an entire new
entry will bring back the original values.
After making any changes, hit <F10> to return to the main menu.
You will be asked whether to save the changes. If not, the changes
will remain in memory only for the current DOCSMASH session, or until you
go to the RESET PARAMS menu. If yes, a file called DOCSMASH.PRN will be
created on the root directory of the logged drive. As long as the .PRN
file exists, DOCSMASH will use only those printer codes in the file, not
the printer codes from the RESET PARAMS menu. To use the codes in RESET
PARAMS, delete the .PRN file. This is easily accomplished from within
DOCSMASH by typing the phrase "KILL PRN FILE" instead of a document name.
(Note: As mentioned before, the Print Width and Page Length, Maximum Blank
Lines Printed, etc. settings are not printer codes, they are program
settings. They must be set to format the output.)
NOTE: The .PRN files created by earlier versions of DOCSMASH are
not compatible with the new versions, 3.1 and higher. Delete the
old \DOCSMASH.PRN file before using the new version.
Programming printer codes can be an imposing problem to non-
programmers. A few users have taken the time to upload files
containing custom printer codes for their printers to the Orchard
Hill BBS (see below). One such file is for the HP Laser Jet II.
If you get your printer set up properly, feel free to send me a
copy of your custom codes along with your registration fee. If
yours is the first I receive for your type printer, I will upload
the information in a file giving you credit for the contribution.
Changing Screen Colors:
-----------------------
At any time, hit <F2> to change screen colors. A menu will appear
that shows the possible screen colors and their corresponding
numbers. Enter a number for the foreground (text) color and the
background color. My preference is white (15) text and blue (1)
background. Monochrome monitor users should use a dark background
color (0).
Displaying a Directory:
-----------------------
When asked for a document name, if the DOS directory command,
"DIR", is entered then the program will shell to DOS and produce
the desired directory. Any valid drive or path may be specified
after the "DIR" command. (This function will only work with DOS
3.0 or higher.)
Changing Directories:
------------------------
When asked for a document name, use the DOS command "CD\", followed
by any valid path name, to change to a new subdirectory. Changing
physical drives is not supported. Printing a document on a drive
other than the logged drive may be done simply by typing the entire
file name, including the drive designation.
Terminating DOCSMASH:
---------------------
At almost any time you may hit <F10> to terminate. If it does not
kick right out, hit <Enter>. Apparently there are a few machines
out there that will not kick out with this command, so you also can
type the word END, instead of a document name, to quit.
Other changes from early versions are:
- No truncating of print that is too wide for a single line. Long
lines will wrap to the next line. One user decided he did not like
word wrap, that he preferred truncating a few letters. Well, you
can't please everybody!
- Progress reports during printing. As pages spool to the printer,
you will see the percent of the file read reported on the screen.
Large print buffers will result in the reported number to be far
ahead of the actual printed output.
One final note, I have tried to make DOCSMASH as general as
possible. With all the different hardware in use these days, it
is difficult to create a printer program that will run with
everything. If you find that your equipment does not function
properly with this program, feel free to send a sample of the
program's output to me at the address shown above. Please include
your name and address and the version number of the program you are
using. If you are using your own printer codes, send that
information, too.
Error Codes:
------------
In the event that DOCSMASH encounters a problem while running,
error codes will be shown on the screen. The manual for IBM's
BASICA or for GWBASIC lists such error codes. You can do a certain
amount of trouble shooting for yourself by looking up the number
of the error code.
=================================================================
Early versions of DOCSMASH were written using Borland's Turbo
Basic. This particular version was compiled using MicroSoft's
Quick Basic.
=================================================================
All the changes made to DOCSMASH since its debut have been the
result of comments sent to the author by users. If you would like
to see something changed or added, or if you just wish to make a
comment about the program, you may leave a message for David
Rettger on the ORCHARD HILL BBS, phone number (708) 974-0282.
(After Dec. 15, 1989 they will have a new number, (708) 361-4547.)
Orchard Hill has DOCSMASH available to non-registered callers.
Call here for latest versions. Also, if you are interested in an
active BBS with a service oriented SYSOP, do consider this one!
On Compuserve, leave a message to the author, 71131,3253.